import socket
import json
import sys
 
client_address = ('127.0.0.1', 31500)
server_address = ('127.0.0.1', 31501)
client_s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
client_s.bind(client_address)

cmd = sys.argv[1] + " " + sys.argv[2] + " " + sys.argv[3]
print(cmd)
json_string = json.dumps(cmd)
client_s.sendto(bytes(json_string,'UTF-8'), server_address)

json_string, addr = client_s.recvfrom(2048)

cmd = json.loads(json_string)
print(cmd)

client_s.close()